<?php
// uncomment the following to define a path alias
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return CMap::mergeArray(array(
			'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
			'name' => 'XSManager',
			'language' => 'zh_cn',
			// preloading 'log' component
			'preload' => array('log', 'bootstrap'),
			// autoloading model and component classes
			'import' => array(
				'application.models.*',
				'application.components.*',
			),
			// application components
			'components' => array(
				'bootstrap' => array(
					'class' => 'application.vendors.YiiBooster.src.components.Bootstrap',
				),
				'user' => array(
					// enable cookie-based authentication
					'class' => 'WebUser',
					'allowAutoLogin' => true,
				),
				// uncomment the following to enable URLs in path-format
				'urlManager' => array(
					'urlFormat' => 'path',
					//'showScriptName' => false,
					'rules' => array(
						'<_c:\w+>/<_a:\w+>' => '<_c>/<_a>',
					),
				),
				// asset manager
				'assetManager' => array(
					'linkAssets' => true,
				),
				// script manager
				'clientScript' => array(
					'class' => 'application.vendors.yii-EClientScript.EClientScript',
					'coreScriptPosition' => CClientScript::POS_END,
					'combineCssFiles' => !YII_DEBUG,
					'combineScriptFiles' => !YII_DEBUG,
					'optimizeCssFiles' => !YII_DEBUG,
					'optimizeScriptFiles' => !YII_DEBUG,
					'optimizeInlineCss' => false,
					'optimizeInlineScript' => false,
				),
				// mysql database
				'db' => array(
					'connectionString' => 'sqlite:' . dirname(__FILE__) . '/../data/db.sqlite',
				),
				// xunsearch project factory
				'pf' => array(
					'class' => 'ProjectFactory',					
				),
				// cache
				'cache' => array(
					'class' => 'system.caching.CFileCache',
				),
				'errorHandler' => array(
					// use 'site/error' action to display errors
					'errorAction' => 'site/error',
				),
				'log' => array(
					'class' => 'CLogRouter',
					'routes' => array(
						array(
							'class' => YII_DEBUG ? 'CWebLogRoute' : 'CFileLogRoute',
							'categories' => 'system.db.*',
							'levels' => (YII_DEBUG ? 'trace, info, ' : '') . 'warning, error',
						),
					),
				),
			),
			// application modules
			'modules' => array(
				// gii
				'gii' => array(
					'class' => 'system.gii.GiiModule',
					'generatorPaths' => array(
						'bootstrap.gii',
					),
					'password' => '123456',
					'ipFilters' => array('127.0.0.1'),
				),
			),
			// application-level parameters that can be accessed
			// using Yii::app()->params['paramName']
			'params' => array(
				'version' => trim(@file_get_contents(dirname(__FILE__) . '/../../VERSION')),
				'fieldType' => array(
					'0' => '字符型', '1' => '数字型', '2' => '日期型',
					'10' => '主键型', '11' => '标题型', '12' => '内容型',
				),
				'accessList' => array(
					//'project/create' => '创建项目',　// 仅管理员拥有
					//'data/list' => '数据列表',	// 有任一项目权限时自动拥有
					'data/create' => '添加数据',
					'data/update' => '修改数据',
					'data/delete' => '删除数据',
					'data/clean' => '清空索引',
					'data/import' => '导入数据',
					//'project/schema' => '项目属性', // 有任一项目权限时自动拥有
					'project/change' => '修改字段',
					'project/log' => '搜索日志',
					'project/hot' => '热门搜索词',
					'project/synonym' => '同义词库',
					'project/dict' => '自定义词库',
					'project/task' => '计划任务',
					'api/put' => 'API: 更新数据',
					'api/del' => 'API: 删除数据',
					'api/clean' => 'API: 清空索引',
					'api/rebuild' => 'API: 重建索引',
					'api/search' => 'API: 普通搜索',
					'api/count' => 'API: 计数搜索',
					'api/hot' => 'API: 热门搜索',
					'api/suggest' => 'API: 搜索建议',
				),
			),
				), require(dirname(__FILE__) . '/custom.php'));
